* textprop.c (set_text_properties_1): Change while to do-while,
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Apr 2011 19:30:48 +0000 (12:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Apr 2011 19:30:48 +0000 (12:30 -0700)
since the condition is always true at first.

src/ChangeLog
src/textprop.c

index a36e307fb42b96d8b75009ccfc92d8759c500e2e..af90960c142afeed6261a17dafb85e812251b44b 100644 (file)
@@ -1,5 +1,8 @@
 2011-04-04  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * textprop.c (set_text_properties_1): Change while to do-while,
+       since the condition is always true at first.
+
        * intervals.c (graft_intervals_into_buffer): Mark var as used.
        (interval_deletion_adjustment): Return unsigned value.
        All uses changed.
index cd89efeb38d5acf32ae7b80f5367308854a97aef..53f92ec936b2393f1852c7ce42f3664d4b0b3ddb 100644 (file)
@@ -1379,8 +1379,8 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie
       i = next_interval (i);
     }
 
-  /* We are starting at the beginning of an interval, I */
-  while (len > 0)
+  /* We are starting at the beginning of an interval I.  LEN is positive.  */
+  do
     {
       if (i == 0)
        abort ();
@@ -1412,6 +1412,7 @@ set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object propertie
 
       i = next_interval (i);
     }
+  while (len > 0);
 }
 
 DEFUN ("remove-text-properties", Fremove_text_properties,